<template>
	<div class="cart-list-item">
		<div class="item-left">
			<!-- <i class="iconfont icon-duigou"></i> -->
			<input type="checkbox" :value="product.isShow" @change="showChange" name="goods" :checked="isChecked">
		</div>
		<div class="item-right">
			<div class="item-image">
				<img :src="product.image" alt="">
			</div>
			<div class="item-content">
				<div class="item-title">
					{{product.title}}
				</div>
				<div class="item-desc">
					{{product.desc}}
				</div>
				<div class="item-price">
					<span class="price">￥{{product.nowPrice}}</span>
					<span class="counter">x{{product.counter}}</span>
				</div>
			</div>
		</div>
	</div>
</template>
 
<script>
	export default {
		name:'CartListItem',
		props:{
			product:{}
		},
		data(){
			return {
				isChecked:'checked'
			}
		},
		watch:{
			product(){
				console.log(this.product)
			}
		},
		methods:{
			showChange(){
				this.product.isShow = !this.product.isShow;
				this.$emit('checkChange');
			}
		}
	}
</script>

<style scoped>
	.cart-list-item {
		display: flex;
		font-size: 14px;
		width: 100vw;
		height: 4rem;
		overflow: hidden;
		border-bottom: 1px solid #ccc;
		margin: 0.4rem 0 ;
	}
	.item-left{
		display: flex;
		justify-content: center;
		align-items: center;
		width: 10%;
	}
	.item-left i{
		border-radius: 100%;
		border: 1px solid #000;
	}
	.item-right{
		display: flex;
		justify-content: center;
		align-items: flex-start;
		flex: 1;
	}
	.item-image {
		width: 30%;
		height: auto;
	}
	.item-image img {
		width: 100%;
		height: auto;
		border-radius: 0.32rem;
	}
	.item-content {
		display: flex;
		flex-direction: column;
		justify-content: right;
		align-items: left;
		flex: 1;
		padding: 0 0.266666rem;
	}
	.item-title,.item-desc {
		width: 5.866666rem;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space:nowrap;
	}
	.item-title {
		padding: 0.266666rem 0;
		font-weight: bold;
	}
	.item-desc {
		padding: 0.4rem 0;
	}
	.item-price {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding-top: 1.333333rem;
	}
	.price{
		color: orangered;
	}
</style>
